<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div.main{
            height: 100px;
            background-color: darkgray;
        }
        div.box{
            width: 100px;
            height: 100px;
            border: solid red;
            background-color: yellow;
            float: right;
        }
        div.father{
            background-color: forestgreen;
            /*overflow: hidden;*/    /*清除浮动 BFC*/
        }
        /*.clear{*/
            /*clear: both;*/
        /*}*/
        /*.clearfix:after{*/
            /*content: '';*/
            /*clear: both;*/
            /*display: block;*/
        /*}*/
    </style>
</head>
<body>
<div class="father clearfix">
<div class="box"></div>
<div class="box"></div>
</div>
<div class="main">
    主页的内容
</div>
</body>
</html>